#include <gtest/gtest.h>
#include <gmock/gmock.h>

class Shape {
public:
    virtual double Area(void) = 0;
};

double GetPrice(class Shape &s)
{
    return s.Area() * 2;
}

class ShapeMock: public Shape {
public:
    MOCK_METHOD(double, Area, (), (override));
};

TEST(ShapeTest, Rectangle)
{
    ShapeMock rect;

    EXPECT_CALL(rect, Area())
        .WillRepeatedly(testing::Return(12));
        
    EXPECT_EQ(24, GetPrice(rect));
}

int main(int argc, char **argv)
{
    testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}